<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>UseGadgetList</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">UseGadgetList()</font></b></p>
<p><b>语法</b></p><blockquote>

Result = <font color="#3A3966"><b>UseGadgetList</b></font>(WindowID)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Select the GadgetList window to which gadgets will be added. If there is no GadgetList on this window so far it will be created. 
(because it was created with the <font color="#924B72">#PB_Window_NoGadgets</font> flag in <a href="../window/openwindow.html">OpenWindow()</a> or because it is not a PB window) 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>WindowID</i></td>
<td width="90%"> 
 
The new window to add gadgets to. It can be obtained with the <a href="../window/windowid.html">WindowID()</a> function. 
If 'WindowID' is 0, the current GadgetList window will be returned and nothing will be changed. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns the WindowID of the previous GadgetList window, or 0 if there was none. This value can be used 
to go back to the previous GadgetList later. 

 

</blockquote><p><b>示例</b></p><blockquote>



This example shows how to use this command to create a new window with gadgets without interrupting the 
gadget creation on the current window: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 500, 500, "Main Window", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">    ButtonGadget</font>(0, 10, 10, 150, 25, "Button 1")
    
    <font color="#3A3966">; Create Window with #PB_Window_NoGadgets to prevent automatic GadgetList creation</font>
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(1, 0, 0, 300, 200, "Child Window", <font color="#924B72">#PB_Window_TitleBar</font> | <font color="#924B72">#PB_Window_WindowCentered</font> | <font color="#924B72">#PB_Window_NoGadgets</font>,<font color="#3A3966"> WindowID</font>(0))
      OldGadgetList =<font color="#3A3966"> UseGadgetList</font>(<font color="#3A3966">WindowID</font>(1)) <font color="#3A3966">; Create GadgetList and store old GadgetList</font>
      
<font color="#3A3966">      ButtonGadget</font>(10, 10, 10, 150, 25, "Child Window Button")
      
<font color="#3A3966">      UseGadgetList</font>(OldGadgetList)               <font color="#3A3966">; Return to previous GadgetList</font>
    <b><font color="#3A3966">EndIf</font></b>
    
<font color="#3A3966">    ButtonGadget</font>(1, 10, 45, 150, 25, "Button 2") <font color="#3A3966">; This will be on the main window again</font>
    
    <b><font color="#3A3966">Repeat</font></b>
    <b><font color="#3A3966">Until</font></b> <font color="#3A3966">WaitWindowEvent</font>() = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="../window/openwindow.html">OpenWindow()</a>, <a href="../window/windowid.html">WindowID()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=unbindgadgetevent.html>UnbindGadgetEvent()</a> - <a href="index.html">Gadget Index</a> - <a href="webgadget.html">WebGadget()</a> -&gt;<br><br>

</body></html>